Cache
public class Cache
Field Summary | |
---|---|
static mixed | |
static mixed |
Method Summary | |
---|---|
static \think\cache\Driver | connect(array options, bool|string name) 连接缓存 |
static void | init(array options) 自动初始化缓存 |
static \think\cache\Driver | store(string name) 切换缓存类型 需要配置 cache.type 为 complex |
static bool | has(string name) 判断缓存是否存在 |
static mixed | get(string name, mixed default) 读取缓存 |
static boolean | set(string name, mixed value, int|null expire) 写入缓存 |
static false|int | inc(string name, int step) 自增缓存(针对数值缓存) |
static false|int | dec(string name, int step) 自减缓存(针对数值缓存) |
static boolean | rm(string name) 删除缓存 |
static boolean | clear(string tag) 清除缓存 |
static \think\cache\Driver | tag(string name, string|array keys, bool overlay) 缓存标签 |
public static mixed $readTimes = 0
public static mixed $writeTimes = 0
public static \think\cache\Driver connect(array options, bool|string name)
连接缓存
public static void init(array options)
自动初始化缓存
public static \think\cache\Driver store(string name)
切换缓存类型 需要配置 cache.type 为 complex
public static bool has(string name)
判断缓存是否存在
public static mixed get(string name, mixed default)
读取缓存
public static boolean set(string name, mixed value, int|null expire)
写入缓存
public static false|int inc(string name, int step)
自增缓存(针对数值缓存)
public static false|int dec(string name, int step)
自减缓存(针对数值缓存)
public static boolean rm(string name)
删除缓存
public static boolean clear(string tag)
清除缓存
public static \think\cache\Driver tag(string name, string|array keys, bool overlay)
缓存标签